package com.wzg.jetpack_blackbox.login.room;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.wzg.jetpack_blackbox.login.room.Converter.BaseListConverter;
import com.wzg.jetpack_blackbox.login.room.Converter.TestBean2Converter;
import com.wzg.jetpack_blackbox.login.room.Converter.UserWorkConverter;
import com.wzg.jetpack_blackbox.login.room.Converter.UserWorkListConverter;

import java.util.List;

/**
 * desc：
 * 1.复杂数据的存储
 * 2.不被持久化的数据
 */
@Entity(tableName = "user_table")
@TypeConverters(value = {
        TestBean2Converter.class,
        UserWorkConverter.class,
        UserWorkListConverter.class
})
public class User {
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "user_id", typeAffinity = ColumnInfo.INTEGER)
    private int id;
    @ColumnInfo(typeAffinity = ColumnInfo.TEXT)
    private String userId;//一般后台都有一个userId唯一值
    @ColumnInfo(typeAffinity = ColumnInfo.TEXT)
    private String name;
    @ColumnInfo(typeAffinity = ColumnInfo.TEXT)
    private String pwd;
    @ColumnInfo(typeAffinity = ColumnInfo.TEXT)
    private String loginTime;
    @Ignore//不被持久化的数据
    private String a;
    //测试list对象
    private List<UserWork> list;
    //测试单个对象
    private UserWork userWork;
    //测试两个对象会发生什么？
    private TestBean2 testBean2;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(String loginTime) {
        this.loginTime = loginTime;
    }

    public String getA() {
        return a;
    }

    public void setA(String a) {
        this.a = a;
    }

    public List<UserWork> getList() {
        return list;
    }

    public void setList(List<UserWork> list) {
        this.list = list;
    }

    public UserWork getUserWork() {
        return userWork;
    }

    public void setUserWork(UserWork userWork) {
        this.userWork = userWork;
    }

    public TestBean2 getTestBean2() {
        return testBean2;
    }

    public void setTestBean2(TestBean2 testBean2) {
        this.testBean2 = testBean2;
    }
}
